{{ content() }}
<div class="row state">
    <div class="col-sm-7 p0">
        <p>{{ title }}</p>
    </div>
    <div class="col-sm-5 p0">
        <button type="button" class="btn btn-info" onclick="select()">查询</button>
        <button type="button" class="btn btn-info" onclick="searchclear()">清除</button>
    </div>
</div>
<div class="row">
    <div class="col-sm-12 form_inquire">
        <form method="post" class="form-inline" id="searchForm">
            {% for element in form %}
        <div class="form-group col-sm-4 form-groupa">
            <div class="form-groupal">
                <label for="{{ element.getName() }}">{{ element.getLabel() }}：</label>
            </div>
            <div class="form-groupar">
                {{ element }}
            </div>
        </div>
            {% endfor %}
        </form>
    </div>
</div>
<div class="row">
    <div class="col-sm-12 us_sheet_ves">
        <div class="us_sheet">
            <div class="us_sheet-child">
                <table class="table table-hover">
                    <thead>
                    <th>统一编号</th>
                    <th>设备名称</th>
                    <th>购置日期</th>
                    <th>资产原值</th>
                    <th>折旧年限</th>
                    <th>残值</th>
                    <th>月折旧</th>
                    <th>累计折旧</th>
                    <th>资产净值</th>
                    </thead>
                    <tbody>
                    {% for ins in page.items %}
                    <tr>
                        <th>{{ ins.unify_number }}</th>
                        <th>{{ ins.ins_name }}</th>
                        <th>{{ ins.buy_at }}</th>
                        <th>{{ ins.cost }}</th>
                        <th>{{ ins.depreciate_year }}</th>
                        <th>{{ ins.scrap_value }}</th>
                        <th>{{ ins.month_cost }}</th>
                        <th>{{ ins.depreciate_total }}</th>
                        <th>{{ ins.surplus_value }}</th>
                    </tr>
                    {% endfor %}
                    </tbody>
                </table>
            </div>
        </div>
        {% if page.total_pages != 0 %}
        <nav class="pull-right">
            <ul class="pagination">
                <li><span>{{ page.current }}/{{ page.total_pages }}</span></li>
                <li>{{ link_to("ins/old", "首页") }}</li>
                <li>{{ link_to("ins/old?page="~page.before, "前一页") }}</li>
                {% for onepage in 1..page.total_pages %}
                    <li>{{ link_to("ins/old?page="~onepage, onepage) }}</li>
                {% endfor %}
                <li>{{ link_to("ins/old?page="~page.next, "下一页") }}</li>
                <li>{{ link_to("ins/old?page="~page.last, "最后一页") }}</li>
            </ul>
        </nav>
        {% endif %}
    </div>
</div>
<script type="text/javascript">
    function select()
    {
        $("#searchForm").submit();
    }
    function searchclear()
    {
        $("#searchForm").append('<input type="hidden" value="true" name="reset"/>');
        select();
    }
</script>
